
//用户名检查
window.checkUname = function(element){
	var uname = element.val();
    var _return = true;
    $.ajax({
    	url: '/register/checkUname',
    	type: 'post',
        async:false,
    	data: {uname:uname},
    	success:function(resault){
    		if (!resault.status) {
    			element.attr('data-original-title', resault.message);
    			_return = false;
    		}
    	}
    })
    return _return;
}

//密码检查
window.checkPwd = function(element){
    var pwd = element.val();
    var _return = true;
    $.ajax({
        url: '/register/checkPwd',
        type: 'post',
        async:false,
        data: {pwd:pwd},
        success:function(resault){
            if (!resault.status) {
                element.attr('data-original-title', resault.message);
                _return = false;
            }
        }
    })
    return _return;
}

$('.reg-form').kyoValidate()
//密码可见
$(".see-btn").click(function() {
    if($(this).hasClass('fa-eye')){
        $("#password").attr({'type':'text'})
        $(".see-btn").removeClass('fa-eye');
        $(".see-btn").addClass('fa-eye-slash');
    }else{
        $("#password").attr({'type':'password'})
        $(".see-btn").removeClass('fa-eye-slash');
        $(".see-btn").addClass('fa-eye');
    }
});